All Questions
31 questions
1vote
2answers
147views
How can I optimize this Binary Search Tree?
I've added some methods to a basic BST implementation for integers - if anyone can point out some ways that this could be written in a more efficient or clean manner, please let me know. ...
3votes
1answer
81views
Data-type implementation for multiple dynamic histograms
This is almost exercise 3.2.14. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne (since I am self-studying, I changed it a little bit): Develop a version of ...
4votes
1answer
731views
java : jumping caterpillar program
Looking for code review, suggestions for improvement, best practices etc. Given N leaves numbered from 1 to N . A caterpillar at leaf 1, jumps from leaf to leaf in multiples of Aj (Aj, 2Aj, 3Aj). ...
1vote
2answers
89views
Class for User-defined Binary data type
I have written a program for a user-defined binary data type in JAVA. It has static methods for purposeful usage methods for binary arithmetic methods for bitwise operations It's working as intended,...
0votes
2answers
144views
ContactsList implementation in Java
I created a ContactsList class in Java that holds Person objects. I consider this is a side project for my GitHub profile. Any ...
2votes
2answers
4kviews
Designing a book library
Description: Design a book library which maintains the book inventory. The library should allow an user to favorite/un-favorite book. The library should allow an user to rent a book for a given ...
4votes
3answers
589views
Counting votes for candidates in a category and region
With the following code, I want to count the Vote objects from a collection, filtering on one of their fields, Candidate. I have the feeling that I can get this done much more efficiently. ...
4votes
2answers
2kviews
Directory JTree Performance
The purpose of this short program is to: Detect all accessible local drives and USB drives List all the accessible directories for each drive which do not require administrator privileges or are ...
0votes
1answer
61views
Building object from unusually custom object
Say we have this method which is my main concern for this question. It's really not optimal way to get values out of it. Each time I'm running through list twice for to just get one field value for <...
3votes
1answer
84views
Notifying players about certain events
This class looks ugly as hell to me. I feel like there is a better way but can't really think for a good one. Too many instanceofs and else ifs. What OOP practices or design patterns would you suggest ...
2votes
1answer
610views
Jesse and Cookies
Jesse loves cookies. He wants the sweetness of all his cookies to be greater than value K. To do this, Jesse repeatedly mixes two cookies with the least sweetness. ...
1vote
1answer
122views
Finding pair in an array with the OO approach
Description: I am trying to solve algorithmic problems mixing them with Object oriented design as part of my interview preparation. So, the question is given an array of integers find the pair of ...
4votes
1answer
271views
A simple MP3 file arranger
I am creating a simple Mp3 Files Arranger the Project is on Github Questions: How can I optimize this app? Am I violating any OOP principle? Is it readable? How can I make it better? GUI.java ...
5votes
2answers
6kviews
Mars Rover Simulator
Problem Statement Consider a rover and a plateau of size nxn. The rover takes three type of instructions L,R and M. 'L' and 'R' rotate the rover in the left and right direction. 'M' moves the ...
2votes
1answer
881views
Raindrops in Java
Problem Statement: Write a program that converts a number to a string, the contents of which depends on the number's prime factors. If the number contains 3 as a prime factor, output '...